package com.CST.entity.zx;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;

@Data
@TableName("ZX_Allocation")
public class ZXAllocation implements Serializable {

    @TableId(value = "id",type = IdType.AUTO)
    @ExcelIgnore
    private Long id;

    @ApiModelProperty(value = "财务编码")
    @ExcelProperty("财务编码")
    private String financialCode;

    @ApiModelProperty(value = "项目简称")
    @ExcelProperty("项目简称")
    private String financialName;

    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @ApiModelProperty(value = "设置时间")
    @ExcelProperty("设置时间")
    private Date createTime;

    @ApiModelProperty(value = "拨款金额")
    @ExcelProperty("拨款金额")
    private BigDecimal appropriationBalance;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ZXAllocation that = (ZXAllocation) o;
        return Objects.equals(financialCode+createTime, that.financialCode+createTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(financialCode+createTime);
    }
}
